package com.kfm.service.impl;

import com.kfm.config.FileConfig;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.kfm.entity.File;
import com.kfm.mapper.FileMapper;
import com.kfm.service.FileService;

import java.io.IOException;
import java.util.List;

@Service
public class FileServiceImpl implements FileService{

    @Resource
    private FileMapper fileMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return fileMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(File record) {
        return fileMapper.insert(record);
    }

    @Override
    public int insertSelective(File record) {
        return fileMapper.insertSelective(record);
    }

    @Override
    public File selectByPrimaryKey(Integer id) {
        return fileMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(File record) {
        return fileMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(File record) {
        return fileMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<File> selectByUserId(Integer userId) {
        return fileMapper.selectByUserId(userId);
    }

    @Override
    public List<File> selectByDirectoryId(Integer directoryId) {
        return fileMapper.selectByDirectoryId(directoryId);
    }

    @Override
    public File selectByMD5AndDirectoryId(String md5, Integer directoryId) {
        return fileMapper.selectByMD5AndDirectoryId(md5, directoryId);
    }
}
